package 网络编程;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author chihb
 * @create-time 2024/7/7 10:27
 * @description
 */
public class Test {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress ipl=InetAddress.getLocalHost();
        System.out.println(ipl.getHostAddress());
        System.out.println(ipl.getHostName());

    }
}
